package Ex241210;

public class HourlyEmployee extends EmployeeVirtual{
    private int hours;
    public HourlyEmployee(String name, int salary, int hours){
        super(name, salary);
        this.hours = hours;
    }
    int calculateSalary(){
        return salary * hours;
    }
    void cout_salary(){
        System.out.print("时薪工" + name + "共工作");
        System.out.print(hours);
        System.out.print("小时，时薪为");
        System.out.print(salary);
        System.out.print("元/h，工资为");
        System.out.print(calculateSalary());
        System.out.println("元。");
    }
}
